package com.example.designModel.observe.process;

import com.google.common.collect.Lists;

import java.util.List;

public class Boss extends Subject {

    private List<Observe> observes = Lists.newArrayList();

    @Override
    void attach(Observe observe) {
        observes.add(observe);
    }

    @Override
    void detach(Observe observe) {
        observes.remove(observe);
    }

    @Override
    void notified() {
        observes.forEach(x->{
            x.Update();
        });
    }
}
